#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int n,r[N + 5],maxn = 0,minn = N;
long long ans = 0;
int f[N + 5];
int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int in;
	cin >> n;
	for(int i = 1;i <= n;i++)
	{
		cin >> in;
		r[in]++;
		maxn = max(maxn,in);
		minn = min(minn,in);
	}
	for(int i = minn;i <= maxn;i++)
	{
		for(int j = i + 1;j <= maxn;j++)
		{
			if(r[i] == 0) break;
			if(r[i] <= r[j] - f[j]) f[j] += r[i],r[i] = 0;
			else r[i] -= r[j],f[j] = r[j];
		}
		ans += r[i];
	}
	cout << ans << endl;
	return 0;
}
